var vm = new Vue({
    el: "#rgzcJobList",
    data: {
        // 工单RFID
        order:null,
        documentUrl:null //工艺指导文件路径
    },
    ready: function() {
    },
    methods: {
        // 显示图片
        showPhoto: function(id) {
            layer.photos({
                photos: '#' + id
                ,anim: 5 //0-6的选择，指定弹出图片动画类型，默认随机（请注意，3.0之前的版本用shift参数）
            })
        },
        // 显示指导文件
        showDocument: function() {
            if (null == this.order || '' == this.order) {
                layer.msg("请扫描RFID")
                return
            }

            layer.open({
                type: 2,
                title: '工艺指导文件',
                shadeClose: true,
                shade: 0.8,
                area: ['90%', '90%'],
                content: "../../script/js/pdfJs/web/viewer.html?file=../../../../manNeedleCart/downFile/" + this.order //iframe的url
            });
        },
        // 异常上报
        abnormalReport: function() {
            layer.open({
                type: 2,
                title: '异常上报',
                shadeClose: true,
                shade: 0.8,
                area: ['90%', '90%'],
                content: "abnormalReport.html" //iframe的url
            });
        },
        // 查找工单信息
        search: function() {
            var _self = this
            this.$http.post(host +"manNeedleCart/jobBook",{"orderNo": this.order},{emulateJSON: true}).then(function(res) {
                if(res.ok  && res.body.result) {
                    if ('undefined' != res.body.isShowPdf &&
                        null != res.body.isShowPdf && res.body.isShowPdf == 1) {
                        _self.showDocument()
                    } else {
                        layer.msg("人工针车报工成功！")
                    }
                } else {
                    layer.msg(res.body.msg)
                }
            });
        }
    }
});